public class AccountAsyncController {
	
	private Account[] accounts;
	//private String AccId{set;get;}
	private String AccId = null;
	
    public AccountAsyncController(ApexPages.StandardController controller) {
		accounts = [select Id, Name from Account];
		AccId = accounts[0].Id;
    }
	
	public Account[] getAcc(){
		return accounts;
	}

	/*public void setAccId(String id){		
		System.debug('inside set '+AccId);
		this.AccId = id;
	}
	
	public String getAccId(String id){		
		System.debug('inside get :'+AccId);
		return AccId;
	}*/
	
	public Contact[] getContacts(){
		
		Contact[] con = [select Name from Contact where AccountId =: AccId];
		System.debug('*********'+con.size());
		return con;
	}
	
	public PageReference display(){
		//AccId = accounts[1].Id;
		AccId = System.currentPageReference().getParameters().get('accId');
		System.debug('inside disply :'+System.currentPageReference().getParameters().get('accId'));
		return null;
	}
}